Skip to content

perf(@angular/build): avoid encoding intermediate source maps before remapping - #33779

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:perf/generate-decoded-source-maps
Aug 6, 2026
Merged

perf(@angular/build): avoid encoding intermediate source maps before remapping#33779
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:perf/generate-decoded-source-maps

Conversation

@clydin

@clydin clydin commented Aug 5, 2026

Copy link
Copy Markdown
Member

Use generateDecodedMap() instead of generateMap() when intermediate source maps created with MagicString are immediately remapped via @ampproject/remapping.

This applies to:

  • oxc-transform: when an input source map is present
  • oxc-linker: when an input source map is present
  • Sass URL rebasing: intermediate stylesheet rebase maps stored for Sass source map merging

Bypassing VLQ base64 encoding and immediate decoding reduces CPU time and temporary memory allocations during source map generation.

…remapping

Use `generateDecodedMap()` instead of `generateMap()` when intermediate source maps created with `MagicString` are immediately remapped via `@ampproject/remapping`.

This applies to:
- `oxc-transform`: when an input source map is present
- `oxc-linker`: when an input source map is present
- Sass URL rebasing: intermediate stylesheet rebase maps stored for Sass source map merging

Bypassing VLQ base64 encoding and immediate decoding reduces CPU time and temporary memory allocations during source map generation.
@angular-robot angular-robot Bot added area: performance Issues related to performance area: @angular/build labels Aug 5, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request optimizes sourcemap generation and remapping across several build tools (including the OXC linker, OXC transform, and Sass rebasing importer) by switching from encoded sourcemaps to decoded sourcemaps (DecodedSourceMap). By utilizing generateDecodedMap instead of generateMap when an input sourcemap is present, it avoids unnecessary encoding and decoding overhead. Additionally, corresponding unit tests have been added to verify sourcemap generation and remapping behavior. There are no review comments, so I have no feedback to provide.

@clydin clydin added target: minor This PR is targeted for the next minor release action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 5, 2026
@clydin
clydin requested a review from alan-agius4 August 6, 2026 00:01
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 6, 2026
@alan-agius4
alan-agius4 merged commit 87551ad into angular:main Aug 6, 2026
44 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build area: performance Issues related to performance target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants